<!DOCTYPE html>
<html lang="zh-cn" ng-app="myapp">
  <head>
    <meta charset="utf8">
    <title>湖南科技大学ACM集训队队员刷题榜</title>
    <meta name="description" content="湖南科技大学ACM集训队队员刷题榜">
    <meta name="author" content="王克纯 &lt;hi@hi-hi.cn&gt;">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="shortcut icon" href="./favicon.ico">
    <link rel="stylesheet" type="text/css" href="./bower_components/bootstrap/dist/css/bootstrap.min.css">
    <script src="./bower_components/jquery/dist/jquery.min.js"></script>
    <script>
    function Login(){
    	var name = $("#name").val().trim();
    	var password = $("#password").val().trim();
    	if(name==""||password==""){
    		alert("用户名或密码不能为空！");
    	}else{
    		$.ajax({
    	        type: "POST",
    	        url:"index.php",
    	        data: { name:name ,password:password },
    	        success: function (data) {      	   
        	        if(data=="success"){
        	        	window.location.href ="index.php";            	       
            	    }else{      
            	    	alert("用户名或密码错误！");   	        	        	
            	    }
    	        }
    	    });	
    	}
    }
    </script>
  </head>
<body>
<h3 class="text-center" style="margin-top: 80px;margin-bottom: 60px;">
	<strong>湖南科技大学ACM集训队刷题榜登入系统</strong>
</h3>
<div class="container">
	<div class="row clearfix">
		<div class="col-md-4 column">
		</div>
		<div class="col-md-4 column">
			<form class="form-horizontal" role="form">
				<div class="form-group">
					 <label for="inputEmail3" class="col-sm-3 control-label">用户名</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" id="name" name="name"/>
					</div>
				</div>
				<div class="form-group">
					 <label for="inputPassword3" class="col-sm-3 control-label">密码</label>
					<div class="col-sm-8">
						<input type="password" class="form-control" id="password" name="password"/>
					</div>
				</div>	
				<div class="form-group">
					<div class="col-sm-offset-3 col-sm-8">
						 <button type="button" class="btn btn-default" onclick="Login()">登入</button>
					</div>
				</div>
			</form>
		</div>
		<div class="col-md-4 column">
		</div>
	</div>
</div>
</body>
</html>